package com.homework.config;

import com.homework.dao.UserDao;
import com.homework.model.User;
import com.homework.model.Role;
import org.springframework.context.annotation.*;

/**
 * @desc:
 * @author: Ping
 * @date: 2024/9/17 23:28
 */
@Configuration
@Import(ResourceConfig.class)
@ComponentScan("com.homework")
public class SpringConfig {
    @Bean
    public UserDao userDao() {
        return new UserDao();
    }

    @Bean
    @Scope("singleton")
    public User user() {
        return new User();
    }

    @Bean
    @Scope("prototype")
    public Role role() {
        return new Role();
    }
}
